#-*- utf-8 -*-

import requests
import json

class RunMain:

    def send_get(self, url, data):
        res = requests.post(url=url, data=data).json()
        # return json.dumps(res, indent=2, sort_keys=True)
        return res

    def send_post(self, url, data):
        res = requests.get(url=url, data=data).json()
        # return json.dumps(res, indent=2, sort_keys=True)
        return res

    def run_main(self, url, method, data=None):
        res = None
        if method == 'GET':
            res = self.send_get(url, data)
        elif method == 'POST':
            res = self.send_post(url, data)
        return res

# if __name__ == '__main__':

#     run = RunMain.run_main()